const mongoose = require('mongoose');
const uris = require('./config/mongodb').uris();

mongoose.connect(uris);

const db = mongoose.connection;

db.on('error', console.error.bind(console, '数据库错误：'));

db.once('open', function () {
    console.log(`数据库连接成功：${uris}`);
});

module.exports = db;